import allure
from selenium.webdriver.common.by import By
from .base import Base
from .page_jumps import PageJumps


class LogIn(Base):    # 登录页
    __LOGIN_URL = "https://litemall.hogwarts.ceshiren.com/#/login?redirect=%2Fdashboard"  # url
    __LOGIN = (By.CSS_SELECTOR, "form > button")

    def login(self):    # 登录
        with allure.step("登录"):
            self.driver.get(self.__LOGIN_URL)
            self.find_click(self.__LOGIN)
        return PageJumps(self.driver)
